package zero.tech.games.log.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Select;

import zero.tech.games.entity.log.LogTrade;

public interface LogTradeMapper {

	void insertBatch(List<LogTrade> list);

	@Select("select count(1) from log_trade where club_id=#{club_id} and uid=#{uid} and create_stamp between #{begin} and #{end}")
	int totalCount(int club_id, int uid, Date begin, Date end);

	@Select("select * from log_trade where club_id=#{club_id} and uid=#{uid} and create_stamp between #{begin} and #{end} limit #{start},#{pageLength}")
	List<LogTrade> listTradeByPage(int club_id, int uid, int start, int pageLength, Date begin, Date end);

	@Select("select count(1) from log_trade where club_id=#{club_id} and uid=#{uid} and other_uid=#{other_uid} and create_stamp between #{begin} and #{end}")
	int totalCountByUid(int club_id, int uid, Date begin, Date end, int other_uid);

	@Select("select * from log_trade where club_id=#{club_id} and uid=#{uid} and other_uid=#{other_uid} and create_stamp between #{begin} and #{end} limit #{start},#{pageLength}")
	List<LogTrade> listTradeByPageAndUid(int club_id, int uid, int start, int pageLength, Date begin, Date end,
			int other_uid);

}
